Check the render method of `Category`. See https://reactjs.org/link/warning-keys for more information.
at FoodCard (http://localhost:3000/static/js/bundle.js:966:5)
at Category (http://localhost:3000/static/js/bundle.js:2829:66)
My error might be generated from this snippet of code but I am not sure.
const Category = () =>{
const {category} = useParams();
const {categoriesMap} = useContext(CategoriesContext);
const[products, setProducts] = useState([categoriesMap[category]]);
useEffect(()=>{
setProducts(categoriesMap[category]);
}, [category, categoriesMap])
return (
<Fragment>
<h2 className='category-title'>{category.toUpperCase()}</h2>
<div className='category-container'>
{products &&
products
.map((food) => (
<FoodCard key={food.id} food={food} />
))}
</div>
</Fragment>
);
};
export default Category;
your issue seems to come from key={food.id}
you should check out your food.id values. There is probably two identical value in your dataset